package com.ag.dgm.service.impl;

import java.util.Arrays;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.ag.dgm.dao.BaseDAOdgm;
import com.ag.dgm.service.IMessageToSendService;
import com.ag.zhh.service.ContactLogService;

@Service("messageToSendServiceImpl")
public class MessageToSendServiceImpl implements IMessageToSendService {

	@Resource(name="baseDAOdgm")
	private BaseDAOdgm baseDAOdgm;
	
	@Resource(name="ContactLogService")
	private ContactLogService messageSend;
	
	@Override
	public void sendMessage(String senderName, String ids, String names,
			String callees, String msg) {
		System.out.println("这是sendMessage_serviceImpl方法");
		String[] idArray = baseDAOdgm.strToArray(ids);					//形如XX,XX,XX   string 变为array的方法
		String[] nameArray=baseDAOdgm.strToArray(names);
		String[] calleesArray = baseDAOdgm.strToArray(callees);
		
		System.out.println(senderName);
		System.out.println(Arrays.toString(idArray));
		System.out.println(Arrays.toString(nameArray));
		System.out.println(Arrays.toString(calleesArray));
		System.out.println(msg);
		
		messageSend.addMessageContactLogByEvent(senderName,nameArray,idArray,calleesArray,msg,null);
	}

}
